package com.zxw.方法引用问题;

/**
 * @projectName: util-cloud
 * @package: com.zxw.indexOf
 * @className: Test
 * @author: zhangxuewei
 * @description: TODO
 * @date: 2024/3/13 14:40
 * @version: 1.0
 */
public class Test {

    public static void swap(A a) {
        String x = a.getX();
        String y = a.getY();
        String temp = x;
        x = y;
        y = temp;
        a.setX(x);
        a.setY(y);
        System.out.println("x:" + a.getX());
        System.out.println("y:" + a.getY());
    }

    public static void main(String[] args) {
        String x = "x";
        String y = "y";
        A a = new A(x, y);
        swap(a);
        System.out.println("x:" + a.getX());
        System.out.println("y:" + a.getY());
    }
}
